<template>
  <div id="app">
    <a-config-provider :locale="locale">
      <template #renderEmpty>
        <c-empty />
      </template>
      <router-view />
    </a-config-provider>
  </div>
</template>

<script>
import zhCN from "ant-design-vue/es/locale/zh_CN";
// import moment from "moment";
import "moment/locale/zh-cn";
import { mapActions } from "vuex";

export default {
  data() {
    return {
      locale: zhCN,
      beforeUnload_time: 0
    };
  },
  methods: {
    ...mapActions(["getCategoryList", "createfutureWs"]),
    setAliIcon() {
      this.$globalSite.aliIcon.forEach(item => {
        const script = document.createElement("script");
        script.type = "text/javascript";
        script.src = "https:" + item;
        document.head.appendChild(script);
      });
    }
  },
  created() {
    if (document.getElementById("spinner"))
      document.getElementById("spinner").remove();
    // 引入阿里图标
    this.setAliIcon();
    // 获取品种
    this.getCategoryList();
    this.createfutureWs();
  }
};
</script>

<style lang="scss">
#nprogress .bar {
  background: var(--primary) !important;
  height: 3px !important;
}
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  width: 100%;
  height: 100%;
}
</style>
